#!/usr/bin/env python3

# def hanshu(name):
#     print("hello world %s" % name )
#
# hanshu("zhangsan")
# hanshu("lisi")


# def change():
#     n = "aaa"
#     print(n)
#
# n = "hahah"
#
# change()

# print(change(n))


# def change():
#     print(names)
#     names["names"] = 33
#     print(names)
#
#
# names = {"names":22}
#
# change()


# def stu_register(name,age,course,hobbie='girl',country='cn',*args):
#     print('------注册学生信息------')
#     print("姓名：",name)
#     print("年龄：",age)
#     print("国籍：",country)
#     print("爱好：",hobbie)
#     print("课程：",course)
#     print("其他：",args)
#
#
# stu_register("zhangsan",22,"linux","man","jp","IT")


# def calc(n):
#     if int(n/2) > 0:
#         calc(int(n/2))
#     print(n/2)
#     exit()
#
#
# print(calc(10))


data = range(1,30000)

def num_search(find_str,data_set):
    mid = int(len(data_set)/2)
    print(mid)
    if data_set[mid] == find_str:
        print("找到了",find_str,data_set(mid))
    elif data_set[mid] > find_str:
        print("去左边找<",data_set[mid],data_set[0:mid])
        num_search(find_str,data_set[0:mid])
    else:
        print("去右边找>",data_set[mid],data_set[mid+1:])
        num_search(find_str,data_set[mid+1:])

num_search(22,data)










